import { createSessionStorage, createStorage } from '@vc/utils';
import { name, version } from '../../package.json';

const prefixKey = name + '_' + version + '_';

/** Todo 加密的 key iv */
export const cacheCipher = {
  key: '_11111000001111@',
  iv: '@11111000001111_'
};

export const ls = createStorage({
  prefixKey
});

export const ss = createSessionStorage({
  prefixKey
});

export const lsNoKey = createStorage();

export const ssNoKey = createSessionStorage();

export const lsEncrypt = createStorage({
  prefixKey,
  hasEncrypt: true,
  key: cacheCipher.key,
  iv: cacheCipher.iv
});

export const ssEncrypt = createSessionStorage({
  prefixKey,
  hasEncrypt: true,
  key: cacheCipher.key,
  iv: cacheCipher.iv
});
